package org.example.mallsystem1104.controller;

import org.example.mallsystem1104.common.Result;
import org.example.mallsystem1104.service.FileService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/file")
@CrossOrigin
public class FileController {
    @Resource
    FileService fileService;

    @GetMapping("{fileName}")
    public void download(@PathVariable String fileName, HttpServletResponse response){
        fileService.download(fileName,response);
    }
}
